package code;

import java.util.ArrayList;

public class QuestionNum_06_6 {
    public static void main(String[] args) {
        phone ph1 = new phone();
        phone ph2 = new phone();
        phone ph3 = new phone();
        phone ph4 = new phone();

        ph1.brand="三星";ph1.color="黑色";ph1.price=6999;
        ph2.brand="小米";ph2.color="黑色";ph2.price=6999;
        ph3.brand="华为";ph3.color="黑色";ph3.price=6999;
        ph4.brand="乐视";ph4.color="黑色";ph4.price=6999;

        ArrayList<phone> arra = new ArrayList<phone>();
        arra.add(ph1);arra.add(ph2);arra.add(ph3);arra.add(ph4);

        for (int i=0;i<arra.size();i++){
            System.out.println("品牌是:"+arra.get(i).brand+" 颜色是:"+arra.get(i).color+" 价格是:"+arra.get(i).price);
        }
    }
}
